﻿using Microsoft.AspNetCore.Mvc;
using Zhp.Api.Attributes;
using Zhp.IService.Monitor;
using Zhp.Model.Monitor;

namespace Zhp.Api.Controllers.Monitor
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiGroup(GroupName = ApiGroupEnum.Monitor)]
    [SeedMenu(MenuGroup = ApiGroupEnum.Monitor, Name = "服务器管理", Order = 1, RouterName = "resource", WebFilePath = "monitor/resource/index", Icon = "server")]
    public class ServerResourceController : ControllerBase
    {
        private readonly IServerResourceService _serverResourceService;

        public ServerResourceController(IServerResourceService serverResourceService)
        {
            _serverResourceService = serverResourceService;
        }

        [HttpGet]
        [NotAuditLog]
        [SeedList("服务器信息", "服务器管理", ApiGroupEnum.Monitor)]
        public async Task<ServerResourceModel> Query()
        {
            var resourcesInfo = await _serverResourceService.Query();

            return resourcesInfo;
        }
    }
}
